package com.slkj.shilixiaoyuanapp.entity.parent;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * 作者：何磊 on 2018/10/11 16:33
 * 描述：
 */
public class SingleBodyartspecialtyEntity implements Parcelable{

    /**
     * id : 17
     * studentName : 裴宗玥
     * hostUnit : tkk测试
     * name : 名称
     * awardLevel : {"aName":"国家级","aId":1}
     * level : {"lName":"一等奖","lId":1}
     * prizeTime : 2018-10-12
     * bigType : 1
     * art : {"name":"喜剧","id":1}
     * image : []
     * auditor : [{"uId":4,"uName":"邓平平","headImg":"http://47.106.8.136:8081/images/school3/head/1534823090482.png","state":0,"refute":""}]
     * state : 0
     * urge : false
     * refute :
     * myState : 0
     * myRefute :
     */

    private int id;
    private String studentName;
    private String hostUnit;
    private String name;
    private AwardLevelEntity awardLevel;
    private LevelEntity level;
    private String prizeTime;
    private int bigType;
    private ArtEntity art;
    private int state;
    private boolean urge;
    private String refute;
    private int myState;
    private String myRefute;
    private List<String> image;
    private List<AuditorEntity> auditor;

    protected SingleBodyartspecialtyEntity(Parcel in) {
        id = in.readInt();
        studentName = in.readString();
        hostUnit = in.readString();
        name = in.readString();
        awardLevel = in.readParcelable(AwardLevelEntity.class.getClassLoader());
        level = in.readParcelable(LevelEntity.class.getClassLoader());
        prizeTime = in.readString();
        bigType = in.readInt();
        art = in.readParcelable(ArtEntity.class.getClassLoader());
        state = in.readInt();
        urge = in.readByte() != 0;
        refute = in.readString();
        myState = in.readInt();
        myRefute = in.readString();
        image = in.createStringArrayList();
        auditor = in.createTypedArrayList(AuditorEntity.CREATOR);
    }

    public static final Creator<SingleBodyartspecialtyEntity> CREATOR = new Creator<SingleBodyartspecialtyEntity>() {
        @Override
        public SingleBodyartspecialtyEntity createFromParcel(Parcel in) {
            return new SingleBodyartspecialtyEntity(in);
        }

        @Override
        public SingleBodyartspecialtyEntity[] newArray(int size) {
            return new SingleBodyartspecialtyEntity[size];
        }
    };

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getStudentName() {
        return studentName;
    }

    public void setStudentName(String studentName) {
        this.studentName = studentName;
    }

    public String getHostUnit() {
        return hostUnit;
    }

    public void setHostUnit(String hostUnit) {
        this.hostUnit = hostUnit;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public AwardLevelEntity getAwardLevel() {
        return awardLevel;
    }

    public void setAwardLevel(AwardLevelEntity awardLevel) {
        this.awardLevel = awardLevel;
    }

    public LevelEntity getLevel() {
        return level;
    }

    public void setLevel(LevelEntity level) {
        this.level = level;
    }

    public String getPrizeTime() {
        return prizeTime;
    }

    public void setPrizeTime(String prizeTime) {
        this.prizeTime = prizeTime;
    }

    public int getBigType() {
        return bigType;
    }

    public void setBigType(int bigType) {
        this.bigType = bigType;
    }

    public ArtEntity getArt() {
        return art;
    }

    public void setArt(ArtEntity art) {
        this.art = art;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public boolean isUrge() {
        return urge;
    }

    public void setUrge(boolean urge) {
        this.urge = urge;
    }

    public String getRefute() {
        return refute;
    }

    public void setRefute(String refute) {
        this.refute = refute;
    }

    public int getMyState() {
        return myState;
    }

    public void setMyState(int myState) {
        this.myState = myState;
    }

    public String getMyRefute() {
        return myRefute;
    }

    public void setMyRefute(String myRefute) {
        this.myRefute = myRefute;
    }

    public List<String> getImage() {
        return image;
    }

    public void setImage(List<String> image) {
        this.image = image;
    }

    public List<AuditorEntity> getAuditor() {
        return auditor;
    }

    public void setAuditor(List<AuditorEntity> auditor) {
        this.auditor = auditor;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(id);
        dest.writeString(studentName);
        dest.writeString(hostUnit);
        dest.writeString(name);
        dest.writeParcelable(awardLevel, flags);
        dest.writeParcelable(level, flags);
        dest.writeString(prizeTime);
        dest.writeInt(bigType);
        dest.writeParcelable(art, flags);
        dest.writeInt(state);
        dest.writeByte((byte) (urge ? 1 : 0));
        dest.writeString(refute);
        dest.writeInt(myState);
        dest.writeString(myRefute);
        dest.writeStringList(image);
        dest.writeTypedList(auditor);
    }

    public static class AwardLevelEntity implements Parcelable{
        /**
         * aName : 国家级
         * aId : 1
         */

        private String aName;
        private int aId;

        protected AwardLevelEntity(Parcel in) {
            aName = in.readString();
            aId = in.readInt();
        }

        public static final Creator<AwardLevelEntity> CREATOR = new Creator<AwardLevelEntity>() {
            @Override
            public AwardLevelEntity createFromParcel(Parcel in) {
                return new AwardLevelEntity(in);
            }

            @Override
            public AwardLevelEntity[] newArray(int size) {
                return new AwardLevelEntity[size];
            }
        };

        public String getAName() {
            return aName;
        }

        public void setAName(String aName) {
            this.aName = aName;
        }

        public int getAId() {
            return aId;
        }

        public void setAId(int aId) {
            this.aId = aId;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(aName);
            dest.writeInt(aId);
        }
    }

    public static class LevelEntity implements Parcelable{
        /**
         * lName : 一等奖
         * lId : 1
         */

        private String lName;
        private int lId;

        protected LevelEntity(Parcel in) {
            lName = in.readString();
            lId = in.readInt();
        }

        public static final Creator<LevelEntity> CREATOR = new Creator<LevelEntity>() {
            @Override
            public LevelEntity createFromParcel(Parcel in) {
                return new LevelEntity(in);
            }

            @Override
            public LevelEntity[] newArray(int size) {
                return new LevelEntity[size];
            }
        };

        public String getLName() {
            return lName;
        }

        public void setLName(String lName) {
            this.lName = lName;
        }

        public int getLId() {
            return lId;
        }

        public void setLId(int lId) {
            this.lId = lId;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(lName);
            dest.writeInt(lId);
        }
    }

    public static class ArtEntity implements Parcelable{
        /**
         * name : 喜剧
         * id : 1
         */

        private String name;
        private int id;

        protected ArtEntity(Parcel in) {
            name = in.readString();
            id = in.readInt();
        }

        public static final Creator<ArtEntity> CREATOR = new Creator<ArtEntity>() {
            @Override
            public ArtEntity createFromParcel(Parcel in) {
                return new ArtEntity(in);
            }

            @Override
            public ArtEntity[] newArray(int size) {
                return new ArtEntity[size];
            }
        };

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(name);
            dest.writeInt(id);
        }
    }

    public static class AuditorEntity implements Parcelable{
        /**
         * uId : 4
         * uName : 邓平平
         * headImg : http://47.106.8.136:8081/images/school3/head/1534823090482.png
         * state : 0
         * refute :
         */

        private int uId;
        private String uName;
        private String headImg;
        private int state;
        private String refute;

        protected AuditorEntity(Parcel in) {
            uId = in.readInt();
            uName = in.readString();
            headImg = in.readString();
            state = in.readInt();
            refute = in.readString();
        }

        public static final Creator<AuditorEntity> CREATOR = new Creator<AuditorEntity>() {
            @Override
            public AuditorEntity createFromParcel(Parcel in) {
                return new AuditorEntity(in);
            }

            @Override
            public AuditorEntity[] newArray(int size) {
                return new AuditorEntity[size];
            }
        };

        public int getUId() {
            return uId;
        }

        public void setUId(int uId) {
            this.uId = uId;
        }

        public String getUName() {
            return uName;
        }

        public void setUName(String uName) {
            this.uName = uName;
        }

        public String getHeadImg() {
            return headImg;
        }

        public void setHeadImg(String headImg) {
            this.headImg = headImg;
        }

        public int getState() {
            return state;
        }

        public void setState(int state) {
            this.state = state;
        }

        public String getRefute() {
            return refute;
        }

        public void setRefute(String refute) {
            this.refute = refute;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeInt(uId);
            dest.writeString(uName);
            dest.writeString(headImg);
            dest.writeInt(state);
            dest.writeString(refute);
        }
    }
}
